set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX aarch64-w64-mingw32)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
find_program(CC_LOCATION ${CMAKE_C_COMPILER}
  NO_PACKAGE_ROOT_PATH
  NO_CMAKE_FIND_ROOT_PATH)
get_filename_component(CC_DIR "${CC_LOCATION}" DIRECTORY)
get_filename_component(PREFIX "${CC_DIR}/../${TOOLCHAIN_PREFIX}" ABSOLUTE)
set(CMAKE_FIND_ROOT_PATH ${PREFIX})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
